<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Amaze UI Admin index Examples</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/png" href="../../static/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="../../static/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <link rel="stylesheet" href="../../static/css/amazeui.min.css"/>
    <link rel="stylesheet" href="../../static/css/admin.css">
    <link rel="stylesheet" href="../../static/css/app.css">
</head>

<body data-type="generalComponents">
<th:block th:include="header::header"></th:block>

<div class="tpl-page-container tpl-page-header-fixed">
    <th:block th:include="menu::menu"></th:block>


    <div class="tpl-content-wrapper">
        <ol class="am-breadcrumb">
            <li><a href="#" class="am-icon-home">首页</a></li>
            <li><a href="#">Amaze UI CSS</a></li>
            <li class="am-active">文字列表</li>
        </ol>
        <div class="tpl-portlet-components">
            <div class="portlet-title">
                <div class="caption font-green bold">
                    <span class="am-icon-code"></span> 首页申请
                </div>

            </div>
            <div class="tpl-block">
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-md-6">
                        <div class="am-btn-toolbar">
                            <div class="am-btn-group am-btn-group-xs">
                                <button type="button" class="am-btn am-btn-default am-btn-secondary">
                                    <span class="am-icon-save"></span> 未审核
                                </button>
                                <button type="button" class="am-btn am-btn-default am-btn-warning">
                                    <span class="am-icon-archive"></span> 通过
                                </button>
                                <button type="button" class="am-btn am-btn-default am-btn-danger">
                                    <span class="am-icon-trash-o"></span> 不通过
                                </button>
                            </div>
                        </div>
                    </div>

                </div>
                <div class="am-g">
                    <div class="am-u-sm-12">
                        <form class="am-form">
                            <table class="am-table am-table-striped am-table-hover table-main">
                                <thead>
                                <tr>
                                    <th class="table-id">ID</th>
                                    <th class="table-title">标题</th>
                                    <th class="table-author am-hide-sm-only">作者</th>
                                    <th class="table-date am-hide-sm-only">申请日期</th>
                                    <th class="table-set">操作</th>
                                </tr>
                                </thead>
                                <tbody id="apply-list">
                                <th:block th:if="${not #lists.isEmpty(applyList)}">
                                    <th:block th:each="apply,index:${applyList}">
                                        <tr>
                                            <td th:text="${index.index}">1</td>
                                            <td><a href="#" th:text="${apply.title}">Business management</a></td>
                                            <td class="am-hide-sm-only" th:text="${apply.nickName}">测试1号</td>
                                            <td class="am-hide-sm-only" th:text="${#dates.format(apply.createTime, 'yyyy年MM月dd日 HH:mm:ss')}">2017年9月4日 7:28:47</td>
                                            <td>
                                                <div class="am-btn-toolbar">
                                                    <div class="am-btn-group am-btn-group-xs">
                                                        <th:block th:if="${apply.applyStatus == 1}">
                                                            <button class="am-btn am-btn-default am-btn-xs am-hide-sm-only" th:onclick="'javascript:updateStatus(\'../apply/'+${apply.articleId}+'/pass\')'"><span
                                                                    class="am-icon-copy"></span> 通过
                                                            </button>
                                                            <button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only" th:onclick="'javascript:updateStatus(\'../apply/'+${apply.articleId}+'/unpass\')'">
                                                                <span class="am-icon-trash-o"></span> 不通过
                                                            </button>
                                                        </th:block>
                                                        <th:block th:if="${apply.applyStatus == 2}">
                                                            <button class="am-btn am-btn-default am-btn-xs am-hide-sm-only">已通过
                                                            </button>
                                                        </th:block>
                                                        <th:block th:if="${apply.applyStatus == 3}">
                                                            <button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only"> 未通过
                                                            </button>
                                                        </th:block>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                    </th:block>
                                </th:block>
                                </tbody>
                            </table>
                            <hr>

                        </form>
                    </div>

                </div>
            </div>
            <div class="tpl-alert"></div>
        </div>


    </div>

</div>


<script src="../../static/js/jquery.min.js"></script>
<script src="../../static/js/amazeui.min.js"></script>
<script src="../../static/js/app.js"></script>


<script>
    function updateStatus(url) {
        $.ajax({
            type: 'PUT',
            url: url,
            dataType: "json",
            data: {},
            success: function (result) {

            }
        });
    }


</script>

</body>

</html>